local sk__guixiu = fk.CreateSkill {

  name = "sk__guixiu",

  tags = {  },

}



sk__guixiu:addEffect(fk.EventPhaseChanging, {
  name = "sk__guixiu",
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    if target == player and player:hasSkill(sk__guixiu.name) and data.phase == Player.Discard then
      return #player.room.logic:getEventsOfScope(GameEvent.Damage, 1, function (e)
        local damage = e.data
        if damage and player == damage.from then
          return true
        end
      end, Player.HistoryTurn) == 0
    end
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(1, sk__guixiu.name)
    return true
  end,
})

return sk__guixiu